package cn.seocoo.platform.api.config;


import cn.seocoo.platform.api.aspectj.LoginUserInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author chenzhanglin
 * @date 2018/12/10 10:29
 **/
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {

  @Autowired
  private LoginUserInterceptor loginUserInterceptor;

  
  @Override
  public void addInterceptors(InterceptorRegistry registry) {
    super.addInterceptors(registry);
    registry.addInterceptor(loginUserInterceptor).addPathPatterns("/api/**").excludePathPatterns("/api/login/**");
  }

}
